com.justhis.jdo
Class JDOUtil

java.lang.Object
  extended bycom.justhis.jdo.JDOUtil

public class JDOUtil
extends java.lang.Object

????Java Data Object????????

Version:
$Revision: 1.1 $
Author:
acai

Method Summary
static void createObject(javax.jdo.PersistenceManager pm, java.lang.Object obj)
          create a persistence object into database by PersistenceManager.
static void createObject(javax.jdo.Transaction transaction, java.lang.Object obj)
          create a persistence object by transaction, through createObject(pm,obj) to persistence object in fact.
static void deleteObject(javax.jdo.PersistenceManager pm, java.lang.Class clazz, java.lang.String objId)
          delete object from Persistence Manager .
static void deleteObject(javax.jdo.Transaction transaction, java.lang.Class clazz, java.lang.String objId)
          delete JDO object from persistence manager
static java.lang.Object findObjectById(javax.jdo.PersistenceManager pm, java.lang.Class clazz, java.lang.String id)
          search JDO Object from persistence manager by JDO object ID .
static java.lang.Object findObjectById(javax.jdo.Transaction transaction, java.lang.Class clazz, java.lang.String objId)
          search JDO object from persistence manager by JDO transaction.
static java.util.Collection findObjList(javax.jdo.PersistenceManager pm, java.lang.Class cs)
          find a jdo object list by class name.
static java.util.Collection findObjList(javax.jdo.PersistenceManager pm, java.lang.Class cs, java.lang.String order)
          find jdo object list ordered
static java.util.Collection findObjList(javax.jdo.PersistenceManager pm, java.lang.Class cs, java.lang.String order, java.lang.String filter)
          find collection of java data object list by filter and order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createObject

public static void createObject(javax.jdo.PersistenceManager pm,
                                java.lang.Object obj)
create a persistence object into database by PersistenceManager.

Parameters:
pm - a persistence manager
obj - needed persistence object

createObject

public static void createObject(javax.jdo.Transaction transaction,
                                java.lang.Object obj)
create a persistence object by transaction, through createObject(pm,obj) to persistence object in fact.

Parameters:
transaction - database transaction
obj - needed persistence object
See Also:
createObject(javax.jdo.PersistenceManager,java.lang.Object)

deleteObject

public static void deleteObject(javax.jdo.PersistenceManager pm,
                                java.lang.Class clazz,
                                java.lang.String objId)
                         throws UtilException
delete object from Persistence Manager .

Parameters:
pm - JDO persistence Manager.
clazz - a class name.
objId - persistence object id.
Throws:
UtilException - if delete from persistence manager occur any error.

deleteObject

public static void deleteObject(javax.jdo.Transaction transaction,
                                java.lang.Class clazz,
                                java.lang.String objId)
                         throws UtilException
delete JDO object from persistence manager

Parameters:
transaction - JDO transaction
clazz - an object class name
objId - JDO object id.
Throws:
UtilException - occur any error.

findObjList

public static java.util.Collection findObjList(javax.jdo.PersistenceManager pm,
                                               java.lang.Class cs)
                                        throws UtilException
find a jdo object list by class name.

Parameters:
pm - persistence manager
cs - class name
Returns:
collection of jdo object
Throws:
UtilException - if any exception occurs

findObjList

public static java.util.Collection findObjList(javax.jdo.PersistenceManager pm,
                                               java.lang.Class cs,
                                               java.lang.String order)
                                        throws UtilException
find jdo object list ordered

Parameters:
pm - persistence manager
cs - class name
order - order name
Returns:
a collection of jdo object
Throws:
UtilException - if any exception occurs.

findObjList

public static java.util.Collection findObjList(javax.jdo.PersistenceManager pm,
                                               java.lang.Class cs,
                                               java.lang.String order,
                                               java.lang.String filter)
                                        throws UtilException
find collection of java data object list by filter and order.

Parameters:
pm - persistence manager
cs - JDO object class name
order - order name
filter - filter expression
Returns:
collection of java data object
Throws:
UtilException - if any exception occurs.

findObjectById

public static java.lang.Object findObjectById(javax.jdo.Transaction transaction,
                                              java.lang.Class clazz,
                                              java.lang.String objId)
                                       throws UtilException
search JDO object from persistence manager by JDO transaction.

Parameters:
transaction - JDO transaction
clazz - a JDO object class name
objId - a JDO object id string
Returns:
an jdo object
Throws:
UtilException - if occur any error.

findObjectById

public static java.lang.Object findObjectById(javax.jdo.PersistenceManager pm,
                                              java.lang.Class clazz,
                                              java.lang.String id)
                                       throws UtilException
search JDO Object from persistence manager by JDO object ID .

Parameters:
pm - persistence manager
clazz - JDO object class name
id - a string of jdo object id
Returns:
a JDO object
Throws:
UtilException - if any exception occur


Copyright © 2003 EastNetworks.Net(China)Co.,Ltd.. All Rights Reserved.